import App from './App'
import en from './locale/en.json'
import zh from './locale/zh.json'


const messages = {
	en,
	zh,
}
console.log('语言是', uni.getLocale())
const lan = uni.getStorageSync('lan')
let i18nConfig = {
	locale: lan ? lan : 'zh', // 获取已设置的语言
	messages
}
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import uviewPlus from 'uview-plus'
import {
	createSSRApp
} from 'vue'
import {
	createI18n
} from 'vue-i18n' // v9.x
export function createApp() {

	const i18n = createI18n(i18nConfig)
	const app = createSSRApp(App)
	app.use(uviewPlus)
	app.use(i18n)
	return {
		app
	}
}
// #endif